<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="/resource/UserPwoer.tld" prefix="p"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	pageContext.setAttribute("fnId", request.getAttribute("fnId"));
	pageContext.setAttribute("userPwoer", request.getSession().getAttribute("userPwoer"));
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>
</head>
<body class="gray-bg">
	
	<div class="ibox-content">
	<!-- 搜索框部分start -->
			<form class="form-inline" id="serchform">
		    <div class="form-group mr-20">
				<label for="name">参数名称</label>
				<input name="paramName" type="text" class="form-control" id="paramName">
			</div>
			<!-- 查询隐藏表单域  begin-->
			<input type="hidden" name="projId" id="projId"  value="" >
			<button  onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search " ></i> 搜索</button>
			<button  type="reset" class="btn btn-info btn-sm"><i class="fa fa-refresh " ></i> 重置</button>
		</form>
		
	<!-- 搜索框部分en -->
	
		<table id="mgrid" >
			<thead>
				<tr>
					<th data-radio="true"  ></th>
					<th data-formatter="MGrid.indexfn" data-align="center"  data-width="30px" >序号</th>
					<th data-field="name">参数名</th>
					<th data-field="paramType" >类型</th>
					<th data-field="isMust" >是必须</th>
					<th data-field="paramPosition" > 参数位置</th>
					<th data-field="defaultValue">默认值</th>
					<th data-field="exp">示例</th>
					<th data-field="remark" >备注</th>
				</tr>
			</thead>
		</table>
		
		<div class="row" >
				<button class="btn btn-primary center-block" onclick="selectoption()" >确认选择</button>
		</div>
	</div>
	
	<script type="text/javascript">
	var myGrid;
		$(function(){
			
			if($.query.get('projId')!=''){
				$("#projId").val($.query.get('projId'));
				 }
			//初始化表格
			 myGrid=MGrid.initGrid({
				 url:"${path}/admin/appInterface/showProjParamList",
				 height:300
			 });
		});
		
	
		/**
		 * 初始化产品列表
		 */
		function initGoodsTypes() {
			$.AjaxProxy({
				a : false,
				c : false
			}).invoke("${path}/admin/goodstype/all", function(loj) {
				$("#goodsSortId").createSelectTree(loj.attr("result").rows, {
					append : true,
					value:"typeName"
				});
			});

		}
		
		
		function selectoption(){
			var arr=myGrid.initParam.$table.bootstrapTable('getSelections');
			parent.selectParam(arr[0]);
			parent.layer.close(parent.layer.getFrameIndex(window.name));
		}
		/**
		 * 库存警戒
		 */
		function overTime(value, row, index) {
			var html = "";
			var alarmNum=row.sku.alarmNum;
			var storeNum=parseInt(value);
			if (alarmNum>=storeNum) {
				html = '<span class="label-danger" >&nbsp;&nbsp;' + value
						+ '&nbsp;&nbsp;</span>';
			} else {
				html = '<span>'+value+'</span>';
			}
			return html;

		}
	</script>
</body>
</html>
